import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 存储token
    Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '',
    radiolist: [
      {
        "id": 1,
        "rid": 1,
        "questionType": "1",
        "stIntroduction": "单选题",
        "stContent": "关于镶套修理法，下面说法不正确的是（  )",
        "stSelecta": "镶套后改变了零件的尺寸",
        "stSelectb": "镶套材料应尽量与基体一致",
        "stSelectc": "镶套采用了过盈配合",
        "stSelectd": "配合表面要求加工精度较高",
        "ksAnswer": "镶套材料应尽量与基体一致",
        "ksScore": 2,
        "stAnswer": "镶套材料应尽量与基体一致",
        "stScore": 2,
        "stExplain": "好好学习css 你就知道优先级了"

      },
      {
        "id": 2, // 题目id
        "rid": 2,
        "questionType": "1", // 题目类型  1，单选，2，多选，3，判断
        "stIntroduction": "单选题",
        "stContent": "在 css 选择器当中，优先级排序正确的是（）",
        "stSelecta": "id选择器>标签选择器>类选择器",
        "stSelectb": "标签选择器>类选择器>id选择器",
        "stSelectc": "类选择器>标签选择器>id选择器",
        "stSelectd": "id选择器>类选择器>标签选择器",
        "ksAnswer": "id选择器>标签选择器>类选择器",
        "ksScore": 0,
        "stAnswer": "id选择器>类选择器>标签选择器",
        "stScore": 2,
        "stExplain": "好好学习css 你就知道优先级了"
      },
      {
        "id": 3,
        "rid": 3,
        "questionType": "1",
        "stIntroduction": "单选题",
        "stContent": "关于镶套修理法，下面说法不正确的是（  )",
        "stSelecta": "镶套后改变了零件的尺寸",
        "stSelectb": "镶套材料应尽量与基体一致",
        "stSelectc": "镶套采用了过盈配合",
        "stSelectd": "配合表面要求加工精度较高",
        "ksAnswer": "镶套材料应尽量与基体一致",
        "ksScore": 2,
        "stAnswer": "镶套材料应尽量与基体一致",
        "stScore": 2,
        "stExplain": "好好学习css 你就知道优先级了"

      },
    ],
    checklist: [
      {
        "id": 1,
        "cid": 1,
        "questionType": "2",
        "stIntroduction": "多选题",
        "stContent": "对磁盘与驱动器中，叙述正确的有()",
        "stSelecta": "密度",
        "stSelectb": "扇区",
        "stSelectc": "磁道",
        "stSelectd": "光标本",
        "ksAnswer": "密度",
        "ksScore": 5,
        "stAnswer": "A,B,C",
        "stScore": 5,
        "stExplain": "好好学习css 你就知道优先级了"
      },
      {
        "id": 2,
        "cid": 2,
        "questionType": "2",
        "stIntroduction": "多选题",
        "stContent": "计算机的主要特点是",
        "stSelecta": "运算速度快",
        "stSelectb": "精度高",
        "stSelectc": "存储记忆",
        "stSelectd": "自动编程",
        "ksAnswer": "运算速度快",
        "ksScore": 5,
        "stAnswer": "A,C,B",
        "stScore": 5,
        "stExplain": "好好学习css 你就知道优先级了"
      },
    ],
    jugelist: [
      {
        "id": 1,
        "jid": 1,
        "questionType": "3",
        "stIntroduction": "判断题",
        "stContent": "int是引用数据类型",
        "stSelecta": "对",
        "stSelectb": "错",
        "ksAnswer": "错",
        "ksScore": 2,
        "stAnswer": "错",
        "stScore": 2,
        "stExplain": "好好学习css 你就知道优先级了"
      },
      {
        "id": 2,
        "jid": 2,
        "questionType": "3",
        "stIntroduction": "判断题",
        "stContent": "string是引用数据类型",
        "stSelecta": "对",
        "stSelectb": "错",
        "ksAnswer": "错",
        "ksScore": 2,
        "stAnswer": "错",
        "stScore": 2,
        "stExplain": "好好学习css 你就知道优先级了"
      },
    ],
    // 单选题目
    radio: [
      {
        id: '1',
        topic: '在 css 选择器当中，优先级排序正确的是（）',
        selectA: 'id选择器>标签选择器>类选择器',
        selectB: '标签选择器>类选择器>id选择器',
        selectC: '类选择器>标签选择器>id选择器',
        selectD: 'id选择器>类选择器>标签选择器',
        rightAnswer: 'D',
        point: 5,
        checked: ''
      },
      {
        id: '2',
        topic: '新窗口打开网页，用到以下哪个值（）',
        selectA: '_self',
        selectB: '_blank',
        selectC: '_top',
        selectD: '_parent',
        rightAnswer: 'B',
        checked: ''

      },
      {
        id: '3',
        topic: '列表分为两类，一是无序列表，一是有序列表，以下哪个是无序列表？（）',
        selectA: '<UL>',
        selectB: '<OL>',
        selectC: '<DIR>',
        selectD: '<DL>',
        rightAnswer: 'A',
        checked: ''

      },
    ],
    // 单选的正确答案
    UserSource: ['D', 'B', 'A'],
    // 多选题目
    checkbox: [
      { id: '4', topic: 'Vue的事件修饰符是（）', selectA: '.stop', selectB: '.prevent', selectC: '.once', selectD: '.enter', rightAnswer1: 'A', rightAnswer2: 'B' },
      { id: '5', topic: '下列关于闭包描述正确的是？（）', selectA: '(function(){})()理论上是一个闭包', selectB: '闭包不耗内存，可以随意使用', selectC: '闭包内变量执行后不会被清除', selectD: '闭包不满足链式作用域结构', rightAnswer1: 'A', rightAnswer2: 'C' }
    ],
    judge: [
      { id: '6', topic: '在 css 选择器当中，优先级排序正确的是（id选择器>类选择器>标签选择器）', selectA: '对', selectB: '错', rightAnswer: '对' }
    ],

  },
  getters: {
  },
  mutations: {
    // 修改token，并将token存入localStorage
    setToken(state, user) {
      state.Authorization = user.Authorization;
      localStorage.setItem('Authorization', user.Authorization);
    },
    updateUserSelect(state, setOP) {
      state.UserSource = setOP
    },
  },
  actions: {
  },
  modules: {
  }
})
